package com.drakeet.multitype.sample.comment.input;

import android.content.Context;
import android.view.View;

import com.drakeet.multitype.sample.R;

/**
 * Describe:
 * Author: lifei
 * Date: 2020/11/9
 * Email: lifei022454@gtjas.com
 */
public class DialogHelper {
    private InputTextMsgDialog inputTextMsgDialog;

    private void showInputTextMsgDialog() {
        inputTextMsgDialog.show();
    }

    public void dismissInputDialog() {
        if (inputTextMsgDialog != null) {
            if (inputTextMsgDialog.isShowing()) inputTextMsgDialog.dismiss();
            inputTextMsgDialog.cancel();
            inputTextMsgDialog = null;
        }
    }

    public void initInputTextMsgDialog(Context context) {
        dismissInputDialog();
        if (inputTextMsgDialog == null) {
            inputTextMsgDialog = new InputTextMsgDialog(context, R.style.dialog_center);
            inputTextMsgDialog.setmOnTextSendListener(new InputTextMsgDialog.OnTextSendListener() {
                @Override
                public void onTextSend(String msg) {

                }

                @Override
                public void dismiss() {
                }
            });
        }
        showInputTextMsgDialog();
    }
}
